﻿using System;
using System.Web.UI.WebControls;
using BLL;

public partial class ViewbyProduct_ViewPIM_PIMTestItemViewbySNDT : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindPIMTestItem();
        }
    }

    private void BindPIMTestItem()
    {
        PIMTestItem testItem = new PIMTestItem();
        string str1 = (string)Session["productSN"];
        DateTime dt1 = (DateTime)Session["testTime"];
        if (str1 != null)
        {
            GridView1.DataSource = testItem.GetPIMTestItembySNDT(str1, dt1);
            GridView1.DataBind();
            for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                if (GridView1.Rows[i].Cells[11].Text == "Fail")
                    GridView1.Rows[i].Cells[11].ForeColor = System.Drawing.Color.Red;
            }
        }
    }
    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.GridView1.PageIndex = e.NewPageIndex;
        BindPIMTestItem();
    }
}
